using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CommerceOne.Domains.IRepositories;
using CommerceOne.Models.Entities;
namespace CommerceOne.Domains.SqlRepositories
{
    public class SqlRecoverQuestionRepository : SqlRepositoryBase, IRecoverQuestionRepository
    {
        #region Singleton Instance
        private static SqlRecoverQuestionRepository _instance;
        public static SqlRecoverQuestionRepository Instance
        {
            get { return _instance ?? (_instance = new SqlRecoverQuestionRepository()); }
        }
        #endregion

        /// <summary>
        /// Gets the active security question.
        /// </summary>
        /// <returns></returns>
        public List<RecoverQuestion> GetActiveSecurityQuestion()
        {
            return this.SqlContext.RecoverQuestions.Where(x => x.Active.HasValue == true && x.Active.Value == true).ToList();
        }
    }
} 
